<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        Promise.prototype.myAny = function (arr) {
            return new Promise((resolve, reject) => {
                let rejectCount = 0, errs = []
                for (let i = 0; i < arr.length; i++) {
                    Promise.resolve(arr[i]).then((val) => {
                        resolve(val)
                    }).catch((err) => {
                        rejectCount++
                        errs.push(err)
                        if (rejectCount === arr.length) {
                            reject(errs)
                        }
                    })
                }
            })
        }
    </script>
</body>

</html>